package com.skywolf.chem.usercenterapi;

import com.skywolf.chem.common.sysconfig.pojo.vo.PageVO;
import com.skywolf.chem.common.sysconfig.response.RespData;
import com.skywolf.chem.manager.entity.PushMessage;
import com.skywolf.chem.manager.entity.PushMessageParam;
import com.skywolf.chem.manager.service.IPushMessageService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.MediaType;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by pei_pei on 2020/7/13.
 */
@RestController
@RequestMapping("/ct/user/jpush")
public class JPushController {

    @Autowired
    IPushMessageService pushMessageService;

    @ApiOperation(value = "推送消息列表",notes = "推送消息列表")
    @RequestMapping(value = "/getPushMsgList",method = {RequestMethod.POST},produces = MediaType.APPLICATION_JSON_UTF8_VALUE)
    public RespData<PushMessage> getPushMsgList(@RequestBody @Validated PushMessageParam queryParam) {
        PageVO<PushMessage> page = pushMessageService.pushMsgListPage(queryParam);
        return RespData.success(page);
    }
}
